import { createRouter, createWebHistory } from 'vue-router'

const Login = () => import('@/view/Login/Login.vue')
const Register = () => import('@/view/Register/Register.vue')
const Home = () => import('@/view/Home/Home.vue')
const Search = () => import('@/view/Search/Search.vue')
const User = () => import('@/view/User/User.vue')
const Userinfo = () => import('@/view/UserInfo/UserInfo.vue')
const PictureInfo = () => import('@/view/PictureInfo/PictureInfo.vue')
const Collect = () => import('@/view/Collect/Collect.vue')
const Manage = () => import('@/view/Manage/Manage.vue')
const ManageUser = () => import('@/components/ManageUser/ManageUser.vue')
const ManagePic = () => import('@/components/ManagePic/ManagePic.vue')

const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home },
    { path: '/search', component: Search },
    { path: '/user', name: 'user', component: User },
    { path: '/login', component: Login },
    { path: '/register', component: Register },
    { path: '/userinfo', component: Userinfo },
    { path: '/pictureinfo/:id', component: PictureInfo },
    { path: '/collect', component: Collect },
    { path: '/manage', component: Manage },
    { path: '/manageuser', component: ManageUser },
    { path: '/managepic', component: ManagePic }
  ]
})

export default router
